﻿import request from '/@/utils/request';
enum Api {
  AddDeviceInfo = '/api/deviceInfo/add',
  DeleteDeviceInfo = '/api/deviceInfo/delete',
  BatchDeleteDeviceInfo = '/api/deviceInfo/batchDelete',
  UpdateDeviceInfo = '/api/deviceInfo/update',
  ImportDeviceInfo = '/api/deviceInfo/import',  
  DownLoadDeviceInfo = '/api/DeviceInfo/DownLoad',
  PageDeviceInfo = '/api/deviceInfo/page',
}
// 导入
export const importDeviceInfo = (params?: any) => {
	const formData = new FormData();
	formData.append('file', params);
	// 请求配置
	const config = {
		headers: {
		},
	};
	request({
		url: Api.ImportDeviceInfo,
		method: 'post',
		headers:{'Content-Type' : 'multipart/form-data'},
		data: formData,
		// data:formData
	});
}
// 增加设备管理
export const addDeviceInfo = (params?: any) =>
	request({
		url: Api.AddDeviceInfo,
		method: 'post',
		data: params,
	});

// 删除设备管理
export const deleteDeviceInfo = (params?: any) => 
	request({
			url: Api.DeleteDeviceInfo,
			method: 'post',
			data: params,
		});
// 批量删除设备管理
export const batchDeleteDeviceInfo = (params?: any) => 
	request({
			url: Api.BatchDeleteDeviceInfo,
			method: 'post',
			data: params,
		});

// 编辑设备管理
export const updateDeviceInfo = (params?: any) => 
	request({
			url: Api.UpdateDeviceInfo,
			method: 'post',
			data: params,
		});

// 分页查询设备管理
export const pageDeviceInfo = (params?: any) => 
	request({
			url: Api.PageDeviceInfo,
			method: 'post',
			data: params,
		});
//下载设备管理模板
export const downLoadDeviceInfo = (params?: any) => 
	request({
			url: Api.DownLoadDeviceInfo,
			method: 'post',
			data: params,
			responseType: 'blob',
		});

